package com.atguigu.spzx.manager.service.impl;

import com.atguigu.spzx.manager.mapper.SysRoleUserMapper;
import com.atguigu.spzx.manager.service.SysRoleUserService;
import com.atguigu.spzx.model.dto.system.AssginRoleDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysRoleUserServiceImpl implements SysRoleUserService {
    @Autowired
    private SysRoleUserMapper sysRoleUserMapper;
    @Override
    public void doAssign(AssginRoleDto assginRoleDto) {
        //删除和该用户有关所有数据
        sysRoleUserMapper.deleteByUserId(assginRoleDto.getUserId());
        //添加新数据
        sysRoleUserMapper.insert(assginRoleDto);

    }
}
